function request(params) {
	if (!params.method) {
		params.method = 'GET'
	}
	return new Promise((resolve, reject) => {
		
		uni.showLoading({
		    title: '加载中'
		});
		
		uni.request({
			...params,
			success: res => {
				resolve(res.data);
			},
			complete() {
				 uni.hideLoading();
			}
		})
	})
}

export default request;
